import request from '@/utils/request'
import {encodeParams} from '@/utils'

//分页列表
export function getList(data) {
  return request({
    url: '/api/express?${encodeParams(data)}',
    method: 'POST',
    data
  })
}

//物流列表
export function list(data) {
  return request({
    url: '/api/express/list',
    method: 'POST',
    data
  })
}
//创建
export function create(data) {
  return request({
    url: '/api/express/create',
    method: 'POST',
    data
  })
}


//根据id查询
export function getById(id) {
  return request({
    url: `/api/express/get/${id}`,
    method: 'GET',
  })
}

//更新
export function update(data) {
  return request({
    url: '/api/express/update',
    method: 'POST',
    data
  })
}
//根据快递名称及物流单号查询快递信息
export function getKuaidiInfo(expName,expNo) {
  return request({
    url: `/api/express/getKuaidiInfo/${expName}/${expNo}`,
    method: 'GET',
  })
}

export default {
  getList, update, getById, create,list,getKuaidiInfo
}
